package com.shawn.springboot.integeration.common.config.shiro.constant;

import cn.hutool.crypto.digest.MD5;

/**
 * @author c
 * @description: Shiro 缓存Key
 * @date 2022/8/21
 */
public class ShiroRedisKey {
    public static String getLoginCodeKey(String phone) {
        return "LOGIN:CODE:" + phone;
    }

    public static String getModifyPasswordCodeKey(String phone) {
        return "MODIFY:PWD:CODE:" + phone;
    }

    public static String getLoginUserKey(String loginName) {
        return "LOGIN:USER:" + loginName;
    }

    public static String getRequestLimitKey(String servletPath, String phone) {
        return "LIMIT:" + MD5.create().digestHex(servletPath + phone);
    }
}
